package com.le.tester.javaThink.fifth.chapter24_ConcurrentProgramming;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

/**
 * createTime：2021/8/18 11:01
 * description：Futures
 */
public class Futures {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        ExecutorService service = Executors.newSingleThreadExecutor();
        Future<Integer> future = service.submit(new CountingTask(99));

        System.out.println(future.get());
        service.shutdown();

    }
}
